package com.wuwei.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: EsConfig <br>
 * @date: 2021/2/27 20:52 <br>
 * @author: wuwei666 <br>
 * @version: 1.0 <br>
 */
@Configuration
public class EsConfig {

    @Bean
    public RestHighLevelClient getRestHighLevelClient(){
        RestHighLevelClient highLevelClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost",9200,"http"))
        );
        return highLevelClient;
    }
}
